#include "RegGrammaticaToNonFinAutTest.h"

RegGrammaticaToNonFinAutTest::RegGrammaticaToNonFinAutTest()
{
}

RegGrammaticaToNonFinAutTest::~RegGrammaticaToNonFinAutTest()
{
}

void RegGrammaticaToNonFinAutTest::testProgram()
{
	cout <<endl;
	cout<<"Regular Grammatica To NDFA"<<endl << "==================================="<<endl<<endl;
	
	list<string> helpSymbols;
	list<char> alphabet;
	
	list<ProductionRule<string> > rules;
	rules.push_back(ProductionRule <string>("q0", '$'));
	rules.push_back(ProductionRule <string>("q0", 'a'));
	rules.push_back(ProductionRule <string>("q0", 'b'));
	rules.push_back(ProductionRule <string>("q0", 'a', "q1"));
	rules.push_back(ProductionRule <string>("q0", 'b', "q2"));
	rules.push_back(ProductionRule <string>("q1", 'a'));
	rules.push_back(ProductionRule <string>("q1", 'b'));
	rules.push_back(ProductionRule <string>("q1", 'a', "q1"));
	rules.push_back(ProductionRule <string>("q1", 'b', "q2"));
	rules.push_back(ProductionRule <string>("q2", 'a', "q1"));
	rules.push_back(ProductionRule <string>("q2", 'b', "q3"));
	rules.push_back(ProductionRule <string>("q2", 'a'));
	rules.push_back(ProductionRule <string>("q2", 'b'));
	rules.push_back(ProductionRule <string>("q3", 'a', "q1"));
	rules.push_back(ProductionRule <string>("q3", 'a'));
	
	RegGrammatica<string> regGrammatica = RegGrammatica<string>(helpSymbols, alphabet, rules, "q0");
	cout << "De Reguliere Grammatica" <<endl<<endl;
	regGrammatica.printLanguage(2);
	regGrammatica.printProdRules();

	//RegGrammaticaToNonFinAut toNonFinAut;
	//NonFinAut<string> nonFinAut = toNonFinAut.convertToNonFinAut(regGrammatica);
	//cout << "De NonFinAut" <<endl<<endl;
	//nonFinAut.print(2);
}
